#include "widget.h"
#include "ui_widget.h"
#include <QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

//    QCursor cursor(Qt::WaitCursor);
//    ui->pushButton->setCursor(cursor);
    QPixmap pixmap(":/icon_test.jpg");
    //缩放：返回一个新的副本
    //pixmap = pixmap.scaled(100,100);
    QCursor cursor(pixmap,10,10);
    this->setCursor(cursor);

    //创建字体
    QFont font;
    font.setFamily("仿宋");
    font.setPixelSize(30);
    font.setBold(true);
    font.setItalic(true);
    font.setUnderline(true);

    ui->label->setFont(font);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_add_clicked()
{
    float opacity = this->windowOpacity();
//    if(opacity>=1.0)
//        return;
    qDebug()<<opacity;
    opacity+=0.1;
    this->setWindowOpacity(opacity);
}

void Widget::on_sub_clicked()
{
    float opacity = this->windowOpacity();
//    if(opacity<=0.0)
//        return;
    qDebug()<<opacity;
    opacity-=0.1;
    this->setWindowOpacity(opacity);
}
